package com.linln.modules.member.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.linln.common.enums.TypeEnum;

import lombok.Data;

/**
 * @author hct
 * @date 2019/09/12
 */
@Data
@Entity
@Table(name="member_read")
@EntityListeners(AuditingEntityListener.class)
public class MemberRead implements Serializable {
    // 主键ID
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long id;
    // 用户id
    private Long memberId;
    //信息id
    private Long typeId;
    private Integer type;
    @Transient
    private String typeValue;
    public String getTypeValue() {
		return TypeEnum.getVal(type); 
	}
    private String area;
    // 创建时间
    @CreatedDate
    private Date createDate;
    // 更新时间
    @LastModifiedDate
    private Date updateDate;
    
}